package com.hyjr.common.enums;

public enum FailFalgEnum {
	FAIL(1, "失败"), SUCCESS(2, "成功");

	private Integer key;
	private String value;

	private FailFalgEnum(Integer key, String value) {
		this.key = key;
		this.value = value;
	}

	// 根据key获取枚举
	public static FailFalgEnum getEnumByKey(Integer key) {
		if (null == key) {
			return null;
		}
		for (FailFalgEnum temp : FailFalgEnum.values()) {
			if (temp.getKey().equals(key)) {
				return temp;
			}
		}
		return null;
	}

	public Integer getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}
}
